var markers = [];
var flightPath;
var callback;
var itemsPerPage = 10;
var perPageOptions = [5, 10, 15,20];
//var HOST_ADDRESS ="http://"+document.domain + ":8080/";
var HOST_ADDRESS ="http://localhost:8080/OmronService/";
// var HOST_ADDRESS ="http://"+window.location.host+"/JetBoard/";

var RECIPE_HOST_ADDRESS ="http://localhost:8080/OmronService/";

var classId= '';
var classChiId= '';

var userName = '';

/*
   message ：显示内容
   type:1：普通dialog 2:警告dialog
 */



function showCommonDialog(message,type) {
    if(1 == type){
        document.getElementById('messageId').innerHTML=message;
        $("#commonModal").modal("show");
    }else {
        document.getElementById('warningMessage').innerHTML=message;
            $("#warningModal").modal("show");
    }
}

function showCommonDialog(message,type,cb) {
    if(1 == type){
        document.getElementById('messageId').innerHTML=message;

        $("#commonModal").modal("show");
        callback = cb;
    }else {
        document.getElementById('warningMessage').innerHTML=message;
        $("#warningModal").modal("show");
        callback = cb;
    }
}

function successCallback() {
    $("#commonModal").modal("toggle");
    if (typeof callback === "function"){
        //alert(callback);
        callback();
        callback=null;
    }
}
function warningCallback() {
    $("#warningModal").modal("toggle");
    if (typeof callback === "function"){
        //alert(callback);
        callback();
        callback=null;
    }
}



/**
 * 判断是否null
 * @param data
 */
function isNull(data){
    return (data == "" || data == undefined || data == null) ? true : false;
}

//获取url参数
function GetQueryString (name)
{
    var after = window.location.hash.split("?")[1];
    if(after)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = after.match(reg);
        if(r != null)
        {
            return  decodeURIComponent(r[2]);
        }
        else
        {
            return null;
        }
    }
}

//设置左边用户姓名
function setUserName (name)
{
    userName = name;
}

function setMenuActivite(liId,childId) {
    classId = liId;
    classChiId = childId;
}

